// eslint-disable-next-line no-undef
const { createApp } = Vue;
createApp({
  data() {
    return {
      txt: '',
      fn1: [],
      fn2: [],
    };
  },
  methods: {
    fn() {
      this.fn1.push({
        txt: this.txt,
        completed: false,
      });
      this.txt = '';
    },
    moveToCompleted(index) {
      const item = this.fn1[index];
      this.fn1.splice(index, 1);
      this.fn2.push({ ...item, completed: item.completed });
    },
    moveToUncompleted(index) {
      const item = this.fn2[index];
      this.fn2.splice(index, 1);
      this.fn1.push({ ...item, completed: item.completed });
    },
  },
}).mount('#app');
